import { request } from '@/utils/request'

/* 过滤设备 */
export function filterSpareDevice(data, callback) {
    return request({
        url: "/spare_part/filter_device",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

/* 过滤供应商 */
export function filterSpareSupplier(data, callback) {
    return request({
        url: "/spare_part/filter_supplier",
        method: 'get',
        data,
        isYarn: true,
    }, callback);
}

/* 过滤区域 */
export function filterSpareArea(data, callback) {
    return request({
        url: "/spare_part/filter_area",
        method: 'get',
        data,
        isYarn: true,
    }, callback);
}

/* 加载备件数据 */
export function loadSparePartData(data, callback) {
    return request({
        url: "/spare_part/list",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

/* 备件盘库 */
export function checkSparePart(data, callback) {
    return request({
        url: "/spare_part/check",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback);
}

/* 备件盘库列表 */
export function loadSparePartCheckData(data, callback) {
    return request({
        url: "/spare_part/check_list",
        method: 'get',
        data,
        isYarn: true,
    }, callback);
}



/* 备件换图片 */
export function changeSparePartPic(data, callback) {
    return request({
        url: "/spare_part/change_pic",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback);
}

/* 申请备件 */
export function applyForSparePart(data, callback) {
    return request({
        url: "/spare_part/apply_for",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback)
}

/* 备件申请列表 */
export function loadSparePartApplyForData(data, callback) {
    return request({
        url: "/spare_part/apply_for_list",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

/* 取消申请 */
export function cancelApplyForSparePart(data, callback) {
    return request({
        url: "/spare_part/cancel_apply_for",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback)
}

/* 审核申请 */
export function checkApplyForSparePart(data, callback) {
    return request({
        url: "/spare_part/check_apply_for",
        method: "post",
        data,
        isYarn: true,
        isFile: true,
    }, callback)
}

/* 备件申请详情 */
export function sparePartApplyForDetail(data, callback) {
    return request({
        url: "/spare_part/apply_for_detail",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

/* 采购入库 */
export function procureIn(data, callback) {
    return request({
        url: "/spare_part/procure_in",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback)
}

/* 备件详情 */
export function sparePartDetail(data, callback) {
    return request({
        url: "/spare_part/detail",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

/* 备件明细详情 */
export function sparePartDetailDetail(data, callback) {
    return request({
        url: "/spare_part/detail_detail",
        method: "get",
        data,
        isYarn: true,
    }, callback);
}

/* 移区 */
export function changeDetailArea(data, callback) {
    return request({
        url: "/spare_part/change_detail_area",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback)
}

/* 领用 */
export function out4Usage(data, callback) {
    return request({
        url: "/spare_part/out_4_usage",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback)
}

/* 未用入库 */
export function in4Unused(data, callback) {
    return request({
        url: "/spare_part/in_4_unused",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback)
}

/* 回收处理 */
export function handleRecycling(data, callback) {
    return request({
        url: "/spare_part/handle_recycling",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback)
}

/* 维修入库 */
export function repairIn(data, callback) {
    return request({
        url: "/spare_part/repair_in",
        method: "post",
        data,
        isYarn: true,
        type: "json"
    }, callback)
}